var request = require("superagent");

function getPassenger(buffer) {
    request.post('https://wx.17u.cn/flightorderdetail/order/orderdetailinfo')
        .set("tcsectoken", '027093039245106135243230197030056045202015212082190244053038211091054223246238095172074148068195091131052177225139141156068169107072219105044138127221143226198081138003204059159017138172156242009162017104101250028125070084005152049053241031101057237207048010011057028115206203246093081221209059155243085132183181')
        .type('form')
        .send({
            IsMuilteSite: 1,
            banner: "2.0.0",
            isFromGuolv: false,
            plat: 518,
            serialNo: buffer
        })
        .end(function (err, res) {
            if (err) {
                console.log(err)
            } else {
                var resJson = JSON.parse(res.text);
                if (resJson.resCode !== 0) {
                    console.log('订单号：' + buffer + '乘客信息获取失败');
                } else {
                    var airplaneModel = resJson.body.segments[0].airplaneModel;
                    var airwaysName = resJson.body.segments[0].saleAirways.airwaysName;
                    var cabinName = resJson.body.segments[0].saleAirways.cabinName;
                    var passenger = resJson.body.segments[0].passengers;

                    var name = '';
                    for (var i = 0; i < passenger.length; i++) {
                        name += passenger[i].passengerName + '('+passenger[i].passengerId + ')';
                    }
                }
            }
        })
}

getPassenger('ODEXE26QD10M7S004525');

